
class DaoPageModel {
    List<DaoItemModel>? list;
    int? pageNum;
    int? pageSize;
    int? total;
    int? totalPage;

    DaoPageModel({this.list, this.pageNum, this.pageSize, this.total, this.totalPage});

    DaoPageModel.fromJson(Map<String, dynamic> json) {
        if(json["list"] is List) {
            list = json["list"] == null ? null : (json["list"] as List).map((e) => DaoItemModel.fromJson(e)).toList();
        }
        if(json["pageNum"] is num) {
            pageNum = (json["pageNum"] as num).toInt();
        }
        if(json["pageSize"] is num) {
            pageSize = (json["pageSize"] as num).toInt();
        }
        if(json["total"] is num) {
            total = (json["total"] as num).toInt();
        }
        if(json["totalPage"] is num) {
            totalPage = (json["totalPage"] as num).toInt();
        }
    }

    static List<DaoPageModel> fromList(List<Map<String, dynamic>> list) {
        return list.map(DaoPageModel.fromJson).toList();
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> _data = <String, dynamic>{};
        if(list != null) {
            _data["list"] = list?.map((e) => e.toJson()).toList();
        }
        _data["pageNum"] = pageNum;
        _data["pageSize"] = pageSize;
        _data["total"] = total;
        _data["totalPage"] = totalPage;
        return _data;
    }

    DaoPageModel copyWith({
        List<DaoItemModel>? list,
        int? pageNum,
        int? pageSize,
        int? total,
        int? totalPage,
    }) => DaoPageModel(
        list: list ?? this.list,
        pageNum: pageNum ?? this.pageNum,
        pageSize: pageSize ?? this.pageSize,
        total: total ?? this.total,
        totalPage: totalPage ?? this.totalPage,
    );
}

class DaoItemModel {
    String? daoIntroduce;
    String? daoName;
    String? headImageUrl;
    int? sort;

    DaoItemModel({this.daoIntroduce, this.daoName, this.headImageUrl, this.sort});

    DaoItemModel.fromJson(Map<String, dynamic> json) {
        if(json["daoIntroduce"] is String) {
            daoIntroduce = json["daoIntroduce"];
        }
        if(json["daoName"] is String) {
            daoName = json["daoName"];
        }
        if(json["headImageUrl"] is String) {
            headImageUrl = json["headImageUrl"];
        }
        if(json["sort"] is num) {
            sort = (json["sort"] as num).toInt();
        }
    }

    static List<DaoItemModel> fromList(List<Map<String, dynamic>> list) {
        return list.map(DaoItemModel.fromJson).toList();
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> _data = <String, dynamic>{};
        _data["daoIntroduce"] = daoIntroduce;
        _data["daoName"] = daoName;
        _data["headImageUrl"] = headImageUrl;
        _data["sort"] = sort;
        return _data;
    }

    DaoItemModel copyWith({
        String? daoIntroduce,
        String? daoName,
        String? headImageUrl,
        int? sort,
    }) => DaoItemModel(
        daoIntroduce: daoIntroduce ?? this.daoIntroduce,
        daoName: daoName ?? this.daoName,
        headImageUrl: headImageUrl ?? this.headImageUrl,
        sort: sort ?? this.sort,
    );
}